home *** CD-ROM | disk | FTP | other *** search
/ Aminet 35 / Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso / Aminet / gfx / misc / gnuplot-src.lha / gnuplot-3.7.1src / gnuplot-3.7.1.lha / gnuplot-3.7.1 / win / pgnuplot.c < prev    next >
Unknown  |  1999-10-19  |  10.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
100% file data default
100% TrID Digital Micrograph Script default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 2f 2a 0a 20 2a 20 70 67 | 6e 75 70 6c 73 2c 20 31 |/*. * pg|nupls, 1|
|00000010| 30 30 30 29 00 00 00 00 | 00 00 00 00 69 6e 20 74 |000)....|....in t|
|00000020| 6f 20 77 67 6e 75 70 6c | 6f 74 0a 20 2a 20 0a 20 |o wgnupl|ot. * . |
|00000030| 2a 20 56 65 72 73 69 6f | 6e 20 30 2e 33 20 2d 2d |* Versio|n 0.3 --|
|00000040| 20 33 30 20 4a 75 6e 20 | 31 39 39 39 0a 20 2a 20 | 30 Jun |1999. * |
|00000050| 0a 20 2a 20 54 68 69 73 | 20 70 72 6f 67 72 61 6d |. * This| program|
|00000060| 20 69 73 20 62 61 73 65 | 64 20 6f 6e 20 70 67 6e | is base|d on pgn|
|00000070| 75 70 6c 6f 74 2e 63 20 | 43 6f 70 79 72 69 67 68 |uplot.c |Copyrigh|
|00000080| 74 20 28 43 29 20 31 39 | 39 39 20 48 61 6e 73 2d |t (C) 19|99 Hans-|
|00000090| 42 65 72 6e 68 61 72 64 | 20 42 72 6f 65 6b 65 72 |Bernhard| Broeker|
|000000a0| 0a 20 2a 20 77 69 74 68 | 20 73 75 62 73 74 61 6e |. * with| substan|
|000000b0| 74 69 61 6c 20 6d 6f 64 | 69 66 69 63 61 74 69 6f |tial mod|ificatio|
|000000c0| 6e 73 20 43 6f 70 79 72 | 69 67 68 74 20 28 43 29 |ns Copyr|ight (C)|
|000000d0| 20 31 39 39 39 20 43 72 | 61 69 67 20 52 2e 20 53 | 1999 Cr|aig R. S|
|000000e0| 63 68 61 72 64 74 2e 0a | 20 2a 0a 20 2a 20 54 68 |chardt..| *. * Th|
|000000f0| 65 20 63 6f 64 65 20 69 | 73 20 72 65 6c 65 61 73 |e code i|s releas|
|00000100| 65 64 20 74 6f 20 74 68 | 65 20 70 75 62 6c 69 63 |ed to th|e public|
|00000110| 20 64 6f 6d 61 69 6e 2e | 0a 20 2a 0a 20 2a 2f 0a | domain.|. *. */.|
|00000120| 0a 2f 2a 20 43 6f 6d 6d | 65 6e 74 73 20 66 72 6f |./* Comm|ents fro|
|00000130| 6d 20 6f 72 69 67 69 6e | 61 6c 20 70 67 6e 75 70 |m origin|al pgnup|
|00000140| 6c 6f 74 2e 63 20 2a 2f | 0a 2f 2a 0a 20 2a 20 70 |lot.c */|./*. * p|
|00000150| 67 6e 75 70 6c 6f 74 2e | 63 20 2d 2d 20 27 50 69 |gnuplot.|c -- 'Pi|
|00000160| 70 65 20 74 6f 20 67 6e | 75 70 6c 6f 74 27 20 20 |pe to gn|uplot' |
|00000170| 56 65 72 73 69 6f 6e 20 | 39 39 30 36 30 38 0a 20 |Version |990608. |
|00000180| 2a 0a 20 2a 20 41 20 73 | 6d 61 6c 6c 20 70 72 6f |*. * A s|mall pro|
|00000190| 67 72 61 6d 2c 20 74 6f | 20 62 65 20 63 6f 6d 70 |gram, to| be comp|
|000001a0| 69 6c 65 64 20 61 73 20 | 61 20 57 69 6e 33 32 20 |iled as |a Win32 |
|000001b0| 63 6f 6e 73 6f 6c 65 20 | 6d 6f 64 65 20 61 70 70 |console |mode app|
|000001c0| 6c 69 63 61 74 69 6f 6e | 2e 0a 20 2a 20 28 4e 42 |lication|.. * (NB|
|000001d0| 3a 20 77 69 6c 6c 20 6e | 6f 74 20 77 6f 72 6b 20 |: will n|ot work |
|000001e0| 6f 6e 20 31 36 62 69 74 | 20 57 69 6e 64 6f 77 73 |on 16bit| Windows|
|000001f0| 2c 20 6e 6f 74 20 65 76 | 65 6e 20 77 69 74 68 20 |, not ev|en with |
|00000200| 57 69 6e 33 32 73 20 69 | 6e 73 74 61 6c 6c 65 64 |Win32s i|nstalled|
|00000210| 29 2e 0a 20 2a 0a 20 2a | 20 54 68 69 73 20 70 72 |).. *. *| This pr|
|00000220| 6f 67 72 61 6d 20 77 69 | 6c 6c 20 61 63 63 65 70 |ogram wi|ll accep|
|00000230| 74 20 63 6f 6d 6d 61 6e | 64 73 20 6f 6e 20 53 54 |t comman|ds on ST|
|00000240| 44 49 4e 2c 20 61 6e 64 | 20 70 69 70 65 20 74 68 |DIN, and| pipe th|
|00000250| 65 6d 20 74 6f 20 61 6e | 0a 20 2a 20 61 63 74 69 |em to an|. * acti|
|00000260| 76 65 20 28 6f 72 20 6e | 65 77 6c 79 20 63 72 65 |ve (or n|ewly cre|
|00000270| 61 74 65 64 29 20 77 67 | 6e 75 70 6c 6f 74 20 74 |ated) wg|nuplot t|
|00000280| 65 78 74 20 77 69 6e 64 | 6f 77 2e 20 43 6f 6d 6d |ext wind|ow. Comm|
|00000290| 61 6e 64 20 6c 69 6e 65 | 20 6f 70 74 69 6f 6e 73 |and line| options|
|000002a0| 0a 20 2a 20 61 72 65 20 | 70 61 73 73 65 64 20 6f |. * are |passed o|
|000002b0| 6e 20 74 6f 20 77 67 6e | 75 70 6c 6f 74 2e 0a 20 |n to wgn|uplot.. |
|000002c0| 2a 0a 20 2a 20 45 66 66 | 65 63 74 69 76 65 6c 79 |*. * Eff|ectively|
|000002d0| 2c 20 74 68 69 73 20 6d | 65 61 6e 73 20 60 70 67 |, this m|eans `pg|
|000002e0| 6e 75 70 6c 6f 74 27 20 | 69 73 20 61 6e 20 61 6c |nuplot' |is an al|
|000002f0| 6d 6f 73 74 20 63 6f 6d | 70 6c 65 74 65 20 73 75 |most com|plete su|
|00000300| 62 73 74 69 74 75 74 65 | 0a 20 2a 20 66 6f 72 20 |bstitute|. * for |
|00000310| 60 77 67 6e 75 70 6c 6f | 74 27 2c 20 6f 6e 20 74 |`wgnuplo|t', on t|
|00000320| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 6c 69 6e 65 2c |he comma|nd line,|
|00000330| 20 77 69 74 68 20 74 68 | 65 20 61 64 64 65 64 20 | with th|e added |
|00000340| 62 65 6e 65 66 69 74 20 | 74 68 61 74 20 69 74 0a |benefit |that it.|
|00000350| 20 2a 20 64 6f 65 73 20 | 61 63 63 65 70 74 20 63 | * does |accept c|
|00000360| 6f 6d 6d 61 6e 64 73 20 | 66 72 6f 6d 20 72 65 64 |ommands |from red|
|00000370| 69 72 65 63 74 65 64 20 | 73 74 64 69 6e 2e 20 28 |irected |stdin. (|
|00000380| 42 65 69 6e 67 20 61 20 | 57 69 6e 64 6f 77 73 20 |Being a |Windows |
|00000390| 47 55 49 0a 20 2a 20 61 | 70 70 6c 69 63 61 74 69 |GUI. * a|pplicati|
|000003a0| 6f 6e 2c 20 60 77 67 6e | 75 70 6c 6f 74 27 20 69 |on, `wgn|uplot' i|
|000003b0| 74 73 65 6c 66 20 63 61 | 6e 6e 6f 74 20 72 65 61 |tself ca|nnot rea|
|000003c0| 64 20 73 74 64 69 6e 20 | 61 74 20 61 6c 6c 2e 29 |d stdin |at all.)|
|000003d0| 0a 20 2a 0a 20 2a 20 43 | 6f 70 79 72 69 67 68 74 |. *. * C|opyright|
|000003e0| 20 28 43 29 20 31 39 39 | 39 20 62 79 20 48 61 6e | (C) 199|9 by Han|
|000003f0| 73 2d 42 65 72 6e 68 61 | 72 64 20 42 72 6f 65 6b |s-Bernha|rd Broek|
|00000400| 65 72 0a 20 2a 20 20 20 | 20 20 20 20 20 20 20 20 |er. * | |
|00000410| 20 20 20 20 20 20 20 20 | 20 20 20 20 28 62 72 6f | | (bro|
|00000420| 65 6b 65 72 40 70 68 79 | 73 69 6b 2e 72 77 74 68 |eker@phy|sik.rwth|
|00000430| 2d 61 61 63 68 65 6e 2e | 64 65 29 0a 20 2a 20 54 |-aachen.|de). * T|
|00000440| 68 69 73 20 66 69 6c 65 | 20 69 73 20 69 6e 20 74 |his file| is in t|
|00000450| 68 65 20 70 75 62 6c 69 | 63 20 64 6f 6d 61 69 6e |he publi|c domain|
|00000460| 2e 20 49 74 20 6d 69 67 | 68 74 20 62 65 63 6f 6d |. It mig|ht becom|
|00000470| 65 20 70 61 72 74 20 6f | 66 20 61 20 66 75 74 75 |e part o|f a futu|
|00000480| 72 65 0a 20 2a 20 64 69 | 73 74 72 69 62 75 74 69 |re. * di|stributi|
|00000490| 6f 6e 20 6f 66 20 67 6e | 75 70 6c 6f 74 2e 0a 20 |on of gn|uplot.. |
|000004a0| 2a 0a 20 2a 20 62 61 73 | 65 64 20 6f 6e 20 61 20 |*. * bas|ed on a |
|000004b0| 70 72 6f 67 72 61 6d 20 | 70 6f 73 74 65 64 20 74 |program |posted t|
|000004c0| 6f 20 63 6f 6d 70 2e 67 | 72 61 70 68 69 63 73 2e |o comp.g|raphics.|
|000004d0| 61 70 70 73 2e 67 6e 75 | 70 6c 6f 74 20 69 6e 20 |apps.gnu|plot in |
|000004e0| 4d 61 79 20 31 39 39 38 | 20 62 79 0a 20 2a 20 6a |May 1998| by. * j|
|000004f0| 6c 20 48 61 6d 65 6c 20 | 3c 6a 6c 68 61 6d 65 6c |l Hamel |<jlhamel|
|00000500| 40 63 65 61 2e 66 72 3e | 0a 20 2a 0a 20 2a 20 43 |@cea.fr>|. *. * C|
|00000510| 68 61 6e 67 65 73 20 72 | 65 6c 61 74 69 76 65 20 |hanges r|elative |
|00000520| 74 6f 20 74 68 61 74 20 | 6f 72 69 67 69 6e 61 6c |to that |original|
|00000530| 20 76 65 72 73 69 6f 6e | 3a 0a 20 2a 20 2d 2d 20 | version|:. * -- |
|00000540| 64 6f 65 73 6e 27 74 20 | 73 74 61 72 74 20 61 20 |doesn't |start a |
|00000550| 6e 65 77 20 77 67 6e 75 | 70 6c 6f 74 20 69 66 20 |new wgnu|plot if |
|00000560| 6f 6e 65 20 61 6c 72 65 | 61 64 79 20 69 73 20 72 |one alre|ady is r|
|00000570| 75 6e 6e 69 6e 67 2e 0a | 20 2a 20 2d 2d 20 64 6f |unning..| * -- do|
|00000580| 65 73 6e 27 74 20 65 6e | 64 20 75 70 20 69 6e 20 |esn't en|d up in |
|00000590| 61 6e 20 65 6e 64 6c 65 | 73 73 20 6c 6f 6f 70 20 |an endle|ss loop |
|000005a0| 69 66 20 53 54 44 49 4e | 20 69 73 20 6e 6f 74 20 |if STDIN| is not |
|000005b0| 72 65 64 69 72 65 63 74 | 65 64 2e 0a 20 2a 20 20 |redirect|ed.. * |
|000005c0| 20 20 28 72 65 66 75 73 | 65 73 20 74 6f 20 72 65 | (refus|es to re|
|000005d0| 61 64 20 66 72 6f 6d 20 | 53 54 44 49 4e 20 61 74 |ad from |STDIN at|
|000005e0| 20 61 6c 6c 2c 20 69 6e | 20 74 68 61 74 20 63 61 | all, in| that ca|
|000005f0| 73 65 29 2e 0a 20 2a 20 | 2d 2d 20 64 6f 65 73 6e |se).. * |-- doesn|
|00000600| 27 74 20 73 74 6f 70 20 | 74 68 65 20 77 67 6e 75 |'t stop |the wgnu|
|00000610| 70 6c 6f 74 20 73 65 73 | 73 69 6f 6e 20 61 74 20 |plot ses|sion at |
|00000620| 74 68 65 20 65 6e 64 20 | 6f 66 0a 20 2a 20 20 20 |the end |of. * |
|00000630| 20 73 74 64 69 6e 2c 20 | 69 66 20 69 74 20 64 69 | stdin, |if it di|
|00000640| 64 6e 27 74 20 73 74 61 | 72 74 20 77 67 6e 75 70 |dn't sta|rt wgnup|
|00000650| 6c 6f 74 20 69 74 73 65 | 6c 66 2e 0a 20 2a 20 2d |lot itse|lf.. * -|
|00000660| 2d 20 61 76 6f 69 64 73 | 20 74 68 65 20 75 73 75 |- avoids| the usu|
|00000670| 61 6c 20 62 75 66 66 65 | 72 20 6f 76 65 72 72 75 |al buffe|r overru|
|00000680| 6e 20 70 72 6f 62 6c 65 | 6d 20 77 69 74 68 20 67 |n proble|m with g|
|00000690| 65 74 73 28 29 2e 0a 20 | 2a 0a 20 2a 20 46 6f 72 |ets().. |*. * For|
|000006a0| 20 74 68 65 20 72 65 63 | 6f 72 64 2c 20 49 20 75 | the rec|ord, I u|
|000006b0| 73 75 61 6c 6c 79 20 75 | 73 65 20 4d 69 6e 47 57 |sually u|se MinGW|
|000006c0| 33 32 20 74 6f 20 63 6f | 6d 70 69 6c 65 20 74 68 |32 to co|mpile th|
|000006d0| 69 73 2c 20 77 69 74 68 | 20 61 0a 20 2a 20 63 6f |is, with| a. * co|
|000006e0| 6d 6d 61 6e 64 20 6c 69 | 6e 65 20 6c 6f 6f 6b 69 |mmand li|ne looki|
|000006f0| 6e 67 20 6c 69 6b 65 20 | 74 68 69 73 3a 0a 20 2a |ng like |this:. *|
|00000700| 0a 20 2a 20 20 20 20 20 | 67 63 63 20 2d 6f 20 70 |. * |gcc -o p|
|00000710| 67 6e 75 70 6c 6f 74 2e | 65 78 65 20 70 67 6e 75 |gnuplot.|exe pgnu|
|00000720| 70 6c 6f 74 2e 63 20 2d | 6c 75 73 65 72 33 32 20 |plot.c -|luser32 |
|00000730| 2d 73 0a 20 2a 2f 0a 0a | 2f 2a 09 4d 6f 64 69 66 |-s. */..|/*.Modif|
|00000740| 69 63 61 74 69 6f 6e 73 | 20 62 79 20 43 72 61 69 |ications| by Crai|
|00000750| 67 20 52 2e 20 53 63 68 | 61 72 64 74 20 28 31 37 |g R. Sch|ardt (17|
|00000760| 20 4a 75 6e 20 31 39 39 | 39 29 0a 09 09 0a 09 43 | Jun 199|9).....C|
|00000770| 6f 70 79 72 69 67 68 74 | 20 28 43 29 20 31 39 39 |opyright| (C) 199|
|00000780| 39 20 62 79 20 43 72 61 | 69 67 20 52 2e 20 53 63 |9 by Cra|ig R. Sc|
|00000790| 68 61 72 64 74 20 28 63 | 72 61 69 67 40 73 69 6c |hardt (c|raig@sil|
|000007a0| 69 63 61 2e 6d 73 65 2e | 75 66 6c 2e 65 64 75 29 |ica.mse.|ufl.edu)|
|000007b0| 0a 0a 09 4d 61 6a 6f 72 | 20 63 68 61 6e 67 65 73 |...Major| changes|
|000007c0| 3a 20 28 53 65 65 20 74 | 68 65 20 65 78 70 6c 61 |: (See t|he expla|
|000007d0| 6e 61 74 69 6f 6e 20 62 | 65 6c 6f 77 20 66 6f 72 |nation b|elow for|
|000007e0| 20 6d 6f 72 65 20 69 6e | 66 6f 72 6d 61 74 69 6f | more in|formatio|
|000007f0| 6e 29 0a 09 09 2b 20 41 | 6c 77 61 79 73 20 73 74 |n)...+ A|lways st|
|00000800| 61 72 74 73 20 61 20 6e | 65 77 20 69 6e 73 74 61 |arts a n|ew insta|
|00000810| 6e 63 65 20 6f 66 20 77 | 67 6e 75 70 6c 6f 74 2e |nce of w|gnuplot.|
|00000820| 0a 09 09 2b 20 49 66 20 | 73 74 64 69 6e 20 69 73 |...+ If |stdin is|
|00000830| 6e 27 74 20 72 65 64 69 | 72 65 63 74 65 64 20 74 |n't redi|rected t|
|00000840| 68 65 6e 20 73 74 61 72 | 74 20 77 67 6e 75 70 6c |hen star|t wgnupl|
|00000850| 6f 74 20 61 6e 64 20 67 | 69 76 65 20 69 74 20 66 |ot and g|ive it f|
|00000860| 6f 63 75 73 2e 0a 09 09 | 2b 20 55 73 65 73 20 43 |ocus....|+ Uses C|
|00000870| 72 65 61 74 65 50 72 6f | 63 65 73 73 28 29 20 69 |reatePro|cess() i|
|00000880| 6e 73 74 65 61 64 20 6f | 66 20 57 69 6e 45 78 65 |nstead o|f WinExe|
|00000890| 63 28 29 20 74 6f 20 73 | 74 61 72 74 20 77 67 6e |c() to s|tart wgn|
|000008a0| 75 70 6c 6f 74 20 77 68 | 65 6e 20 73 74 64 69 6e |uplot wh|en stdin|
|000008b0| 0a 09 09 20 20 69 73 20 | 72 65 64 69 72 65 63 74 |... is |redirect|
|000008c0| 65 64 2e 0a 09 0a 09 4f | 74 68 65 72 20 63 68 61 |ed.....O|ther cha|
|000008d0| 6e 67 65 73 3a 0a 09 09 | 2b 20 4e 65 77 20 74 65 |nges:...|+ New te|
|000008e0| 63 68 6e 69 71 75 65 20 | 66 6f 72 20 62 75 69 6c |chnique |for buil|
|000008f0| 64 69 6e 67 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |ding the| command|
|00000900| 20 6c 69 6e 65 20 74 6f | 20 70 61 73 73 20 74 6f | line to| pass to|
|00000910| 20 77 67 6e 75 70 6c 6f | 74 2e 65 78 65 0a 09 09 | wgnuplo|t.exe...|
|00000920| 20 20 77 68 69 63 68 20 | 69 73 20 6c 65 73 73 20 | which |is less |
|00000930| 63 6f 6d 70 6c 69 63 61 | 74 65 64 20 61 6e 64 20 |complica|ted and |
|00000940| 73 65 65 6d 73 20 74 6f | 20 77 6f 72 6b 20 6d 6f |seems to| work mo|
|00000950| 72 65 20 72 65 6c 69 61 | 62 6c 79 20 74 68 61 6e |re relia|bly than|
|00000960| 20 74 68 65 20 6f 6c 64 | 20 0a 09 09 20 20 74 65 | the old| ... te|
|00000970| 63 68 6e 69 71 75 65 2e | 0a 09 09 2b 20 53 69 6d |chnique.|...+ Sim|
|00000980| 70 6c 69 66 69 65 64 20 | 6d 65 73 73 61 67 65 20 |plified |message |
|00000990| 70 61 73 73 69 6e 67 20 | 73 65 63 74 69 6f 6e 20 |passing |section |
|000009a0| 6f 66 20 74 68 65 20 63 | 6f 64 65 2e 20 0a 09 09 |of the c|ode. ...|
|000009b0| 2b 20 41 6c 6c 20 70 72 | 69 6e 74 66 28 2e 2e 2e |+ All pr|intf(...|
|000009c0| 29 20 73 74 61 74 65 6d | 65 6e 74 73 20 61 72 65 |) statem|ents are|
|000009d0| 20 6e 6f 77 20 66 70 72 | 69 6e 74 66 28 73 74 64 | now fpr|intf(std|
|000009e0| 65 72 72 2c 2e 2e 2e 29 | 20 73 6f 20 74 68 61 74 |err,...)| so that|
|000009f0| 20 65 72 72 6f 72 73 20 | 0a 09 09 20 20 61 72 65 | errors |... are|
|00000a00| 20 73 65 6e 74 20 74 6f | 20 74 68 65 20 63 6f 6e | sent to| the con|
|00000a10| 73 6f 6c 65 2c 20 65 76 | 65 6e 20 69 66 20 73 74 |sole, ev|en if st|
|00000a20| 64 6f 75 74 20 69 73 20 | 72 65 64 69 72 65 63 74 |dout is |redirect|
|00000a30| 65 64 2e 0a 0a 09 54 68 | 65 20 70 72 65 76 69 6f |ed....Th|e previo|
|00000a40| 75 73 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 70 67 |us versi|on of pg|
|00000a50| 6e 75 70 6c 6f 74 20 77 | 6f 75 6c 64 20 66 61 69 |nuplot w|ould fai|
|00000a60| 6c 20 77 68 65 6e 20 6d | 6f 72 65 20 74 68 61 6e |l when m|ore than|
|00000a70| 20 6f 6e 65 20 70 72 6f | 67 72 61 6d 0a 09 74 72 | one pro|gram..tr|
|00000a80| 69 65 64 20 74 6f 20 61 | 63 63 65 73 73 20 77 67 |ied to a|ccess wg|
|00000a90| 6e 75 70 6c 6f 74 20 73 | 69 6d 75 6c 74 61 6e 65 |nuplot s|imultane|
|00000aa0| 6f 75 73 6c 79 20 6f 72 | 20 77 68 65 6e 20 6f 6e |ously or| when on|
|00000ab0| 65 20 70 72 6f 67 72 61 | 6d 20 74 72 69 65 64 20 |e progra|m tried |
|00000ac0| 74 6f 20 73 74 61 72 74 | 0a 09 6d 6f 72 65 20 74 |to start|..more t|
|00000ad0| 68 61 6e 20 6f 6e 65 20 | 77 67 6e 75 70 6c 6f 74 |han one |wgnuplot|
|00000ae0| 20 73 65 73 73 69 6f 6e | 2e 20 4f 6e 6c 79 20 61 | session|. Only a|
|00000af0| 20 73 69 6e 67 6c 65 20 | 69 6e 73 74 61 6e 63 65 | single |instance|
|00000b00| 20 6f 66 20 77 67 6e 75 | 70 6c 6f 74 20 77 6f 75 | of wgnu|plot wou|
|00000b10| 6c 64 20 62 65 0a 09 73 | 74 61 72 74 65 64 20 61 |ld be..s|tarted a|
|00000b20| 6e 64 20 61 6c 6c 20 69 | 6e 70 75 74 20 77 6f 75 |nd all i|nput wou|
|00000b30| 6c 64 20 62 65 20 73 65 | 6e 74 20 74 6f 20 74 68 |ld be se|nt to th|
|00000b40| 61 74 20 69 6e 73 74 61 | 6e 63 65 2e 20 57 68 65 |at insta|nce. Whe|
|00000b50| 6e 20 74 77 6f 20 6f 72 | 20 6d 6f 72 65 20 70 72 |n two or| more pr|
|00000b60| 6f 67 72 61 6d 73 0a 09 | 74 72 69 65 64 20 74 6f |ograms..|tried to|
|00000b70| 20 70 69 70 65 20 69 6e | 70 75 74 20 74 6f 20 77 | pipe in|put to w|
|00000b80| 67 6e 75 70 6c 6f 74 2c | 20 74 68 65 20 74 77 6f |gnuplot,| the two|
|00000b90| 20 73 65 70 65 72 61 74 | 65 20 69 6e 70 75 74 20 | seperat|e input |
|00000ba0| 73 74 72 65 61 6d 73 20 | 77 6f 75 6c 64 20 62 65 |streams |would be|
|00000bb0| 20 73 65 6e 74 20 0a 09 | 74 6f 20 6f 6e 65 20 77 | sent ..|to one w|
|00000bc0| 67 6e 75 70 6c 6f 74 20 | 77 69 6e 64 6f 77 20 72 |gnuplot |window r|
|00000bd0| 65 73 75 6c 74 69 6e 67 | 20 69 6e 20 6f 6e 65 20 |esulting| in one |
|00000be0| 76 65 72 79 20 63 6f 6e | 66 75 73 65 64 20 63 6f |very con|fused co|
|00000bf0| 70 79 20 6f 66 20 77 67 | 6e 75 70 6c 6f 74 2e 20 |py of wg|nuplot. |
|00000c00| 54 68 65 20 6f 6e 6c 79 | 0a 09 77 61 79 20 74 6f |The only|..way to|
|00000c10| 20 61 76 6f 69 64 20 74 | 68 69 73 20 70 72 6f 62 | avoid t|his prob|
|00000c20| 6c 65 6d 20 77 61 73 20 | 74 6f 20 63 68 61 6e 67 |lem was |to chang|
|00000c30| 65 20 70 67 6e 75 70 6c | 6f 74 20 73 6f 20 74 68 |e pgnupl|ot so th|
|00000c40| 61 74 20 69 74 20 77 6f | 75 6c 64 20 73 74 61 72 |at it wo|uld star|
|00000c50| 74 20 61 20 0a 09 6e 65 | 77 20 69 6e 73 74 61 6e |t a ..ne|w instan|
|00000c60| 63 65 20 6f 66 20 77 67 | 6e 75 70 6c 6f 74 20 65 |ce of wg|nuplot e|
|00000c70| 76 65 72 79 20 74 69 6d | 65 2e 0a 0a 09 4a 75 73 |very tim|e....Jus|
|00000c80| 74 20 73 74 61 72 74 69 | 6e 67 20 61 20 6e 65 77 |t starti|ng a new|
|00000c90| 20 69 6e 73 74 61 6e 63 | 65 20 6f 66 20 77 67 6e | instanc|e of wgn|
|00000ca0| 75 70 6c 6f 74 20 69 73 | 6e 27 74 20 65 6e 6f 75 |uplot is|n't enou|
|00000cb0| 67 68 2e 20 70 67 6e 75 | 70 6c 6f 74 20 6d 75 73 |gh. pgnu|plot mus|
|00000cc0| 74 20 61 6c 73 6f 0a 09 | 6d 61 6b 65 20 73 75 72 |t also..|make sur|
|00000cd0| 65 20 74 68 61 74 20 74 | 68 65 20 64 61 74 61 20 |e that t|he data |
|00000ce0| 6f 6e 20 65 61 63 68 20 | 73 74 64 69 6e 20 70 69 |on each |stdin pi|
|00000cf0| 70 65 20 69 73 20 73 65 | 6e 74 20 74 6f 20 74 68 |pe is se|nt to th|
|00000d00| 65 20 70 72 6f 70 65 72 | 20 77 67 6e 75 70 6c 6f |e proper| wgnuplo|
|00000d10| 74 20 0a 09 69 6e 73 74 | 61 6e 63 65 2e 20 54 68 |t ..inst|ance. Th|
|00000d20| 69 73 20 69 73 20 61 63 | 68 69 65 76 65 64 20 62 |is is ac|hieved b|
|00000d30| 79 20 75 73 69 6e 67 20 | 43 72 65 61 74 65 50 72 |y using |CreatePr|
|00000d40| 6f 63 65 73 73 28 29 20 | 77 68 69 63 68 20 72 65 |ocess() |which re|
|00000d50| 74 75 72 6e 73 20 61 20 | 68 61 6e 64 6c 65 20 0a |turns a |handle .|
|00000d60| 09 74 6f 20 74 68 65 20 | 6e 65 77 6c 79 20 63 72 |.to the |newly cr|
|00000d70| 65 61 74 65 64 20 70 72 | 6f 63 65 73 73 2e 20 4f |eated pr|ocess. O|
|00000d80| 6e 63 65 20 74 68 65 20 | 70 72 6f 63 65 73 73 20 |nce the |process |
|00000d90| 68 61 73 20 69 6e 69 74 | 69 61 6c 69 7a 65 64 2c |has init|ialized,|
|00000da0| 20 69 74 20 63 61 6e 20 | 62 65 20 0a 09 73 65 61 | it can |be ..sea|
|00000db0| 72 63 68 65 64 20 66 6f | 72 20 74 68 65 20 74 65 |rched fo|r the te|
|00000dc0| 78 74 20 77 69 6e 64 6f | 77 20 61 6e 64 20 74 68 |xt windo|w and th|
|00000dd0| 65 6e 20 64 61 74 61 20 | 63 61 6e 20 62 65 20 72 |en data |can be r|
|00000de0| 6f 75 74 65 64 20 63 6f | 72 72 65 63 74 6c 79 2e |outed co|rrectly.|
|00000df0| 20 54 68 65 20 73 65 61 | 72 63 68 20 0a 09 69 73 | The sea|rch ..is|
|00000e00| 20 63 61 72 72 69 65 64 | 20 6f 75 74 20 62 79 20 | carried| out by |
|00000e10| 74 68 65 20 45 6e 75 6d | 54 68 72 65 61 64 57 69 |the Enum|ThreadWi|
|00000e20| 6e 64 6f 77 73 28 29 20 | 63 61 6c 6c 20 61 6e 64 |ndows() |call and|
|00000e30| 20 74 68 65 20 64 61 74 | 61 20 70 61 73 73 69 6e | the dat|a passin|
|00000e40| 67 20 69 73 20 63 61 72 | 72 69 65 64 20 0a 09 6f |g is car|ried ..o|
|00000e50| 75 74 20 62 79 20 61 20 | 72 65 77 72 69 74 74 65 |ut by a |rewritte|
|00000e60| 6e 20 76 65 72 73 69 6f | 6e 20 6f 66 20 74 68 65 |n versio|n of the|
|00000e70| 20 6f 72 69 67 69 6e 61 | 6c 20 63 6f 64 65 2e 20 | origina|l code. |
|00000e80| 57 69 74 68 20 74 68 65 | 73 65 20 63 68 61 6e 67 |With the|se chang|
|00000e90| 65 73 2c 20 70 67 6e 75 | 70 6c 6f 74 20 0a 09 6e |es, pgnu|plot ..n|
|00000ea0| 6f 77 20 62 65 68 61 76 | 65 73 20 69 6e 20 61 20 |ow behav|es in a |
|00000eb0| 6d 61 6e 6e 65 72 20 63 | 6f 6e 73 69 73 74 65 6e |manner c|onsisten|
|00000ec0| 74 20 77 69 74 68 20 74 | 68 65 20 62 65 68 61 76 |t with t|he behav|
|00000ed0| 69 6f 72 20 6f 66 20 67 | 6e 75 70 6c 6f 74 20 6f |ior of g|nuplot o|
|00000ee0| 6e 20 55 4e 49 58 20 0a | 09 63 6f 6d 70 75 74 65 |n UNIX .|.compute|
|00000ef0| 72 73 2e 0a 0a 09 54 68 | 69 73 20 70 72 6f 67 72 |rs....Th|is progr|
|00000f00| 61 6d 20 68 61 73 20 62 | 65 65 6e 20 63 6f 6d 70 |am has b|een comp|
|00000f10| 69 6c 65 64 20 75 73 69 | 6e 67 20 4d 69 63 72 6f |iled usi|ng Micro|
|00000f20| 73 6f 66 74 20 56 69 73 | 75 61 6c 20 43 2b 2b 20 |soft Vis|ual C++ |
|00000f30| 34 2e 30 20 77 69 74 68 | 20 74 68 65 0a 09 66 6f |4.0 with| the..fo|
|00000f40| 6c 6c 6f 77 69 6e 67 20 | 63 6f 6d 6d 61 6e 64 20 |llowing |command |
|00000f50| 6c 69 6e 65 3a 0a 0a 09 | 09 63 6c 20 2f 4f 32 20 |line:...|.cl /O2 |
|00000f60| 70 67 6e 75 70 6c 6f 74 | 2e 63 20 2f 6c 69 6e 6b |pgnuplot|.c /link|
|00000f70| 20 75 73 65 72 33 32 2e | 6c 69 62 0a 0a 09 54 68 | user32.|lib...Th|
|00000f80| 65 20 72 65 73 75 6c 74 | 69 6e 67 20 70 72 6f 67 |e result|ing prog|
|00000f90| 72 61 6d 20 68 61 73 20 | 62 65 65 6e 20 74 65 73 |ram has |been tes|
|00000fa0| 74 65 64 20 6f 6e 20 57 | 69 6e 4e 54 20 61 6e 64 |ted on W|inNT and|
|00000fb0| 20 57 69 6e 39 38 20 62 | 6f 74 68 20 62 79 20 63 | Win98 b|oth by c|
|00000fc0| 61 6c 6c 69 6e 67 0a 09 | 69 74 20 64 69 72 65 63 |alling..|it direc|
|00000fd0| 74 6c 79 20 66 72 6f 6d | 20 74 68 65 20 63 6f 6d |tly from| the com|
|00000fe0| 6d 61 6e 64 20 6c 69 6e | 65 20 77 69 74 68 20 61 |mand lin|e with a|
|00000ff0| 6e 64 20 77 69 74 68 6f | 75 74 20 72 65 64 69 72 |nd witho|ut redir|
|00001000| 65 63 74 65 64 20 69 6e | 70 75 74 2e 20 54 68 65 |ected in|put. The|
|00001010| 0a 09 70 72 6f 67 72 61 | 6d 20 61 6c 73 6f 20 77 |..progra|m also w|
|00001020| 6f 72 6b 73 20 6f 6e 20 | 57 69 6e 4e 54 20 77 69 |orks on |WinNT wi|
|00001030| 74 68 20 61 20 6d 6f 64 | 69 66 69 65 64 20 76 65 |th a mod|ified ve|
|00001040| 72 73 69 6f 6e 20 6f 66 | 20 47 6e 75 70 6c 6f 74 |rsion of| Gnuplot|
|00001050| 2e 70 79 20 28 61 20 73 | 63 72 69 70 74 0a 09 66 |.py (a s|cript..f|
|00001060| 6f 72 20 69 6e 74 65 72 | 61 63 74 69 76 65 20 63 |or inter|active c|
|00001070| 6f 6e 74 72 6f 6c 20 6f | 66 20 47 6e 75 70 6c 6f |ontrol o|f Gnuplo|
|00001080| 74 20 66 72 6f 6d 20 50 | 79 74 68 6f 6e 29 2e 20 |t from P|ython). |
|00001090| 0a 09 0a 09 32 32 20 4a | 55 4e 20 31 39 39 39 3a |....22 J|UN 1999:|
|000010a0| 0a 09 2b 20 46 69 78 65 | 64 20 63 6f 6d 6d 61 6e |..+ Fixe|d comman|
|000010b0| 64 20 6c 69 6e 65 20 63 | 6f 64 65 20 74 6f 20 62 |d line c|ode to b|
|000010c0| 65 68 61 76 65 20 70 72 | 6f 70 65 72 6c 79 20 77 |ehave pr|operly w|
|000010d0| 68 65 6e 20 74 68 65 20 | 66 69 72 73 74 0a 09 20 |hen the |first.. |
|000010e0| 20 69 74 65 6d 20 69 73 | 20 71 75 6f 74 65 64 20 | item is| quoted |
|000010f0| 69 6e 20 74 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |in the o|riginal |
|00001100| 63 6f 6d 6d 61 6e 64 20 | 6c 69 6e 65 2e 0a 09 0a |command |line....|
|00001110| 09 32 39 20 4a 55 4e 20 | 31 39 39 39 3a 0a 09 2b |.29 JUN |1999:..+|
|00001120| 20 41 64 64 65 64 20 73 | 6f 6d 65 20 63 6f 64 65 | Added s|ome code|
|00001130| 20 74 6f 20 70 72 69 6e | 74 20 74 68 65 20 63 6f | to prin|t the co|
|00001140| 6d 6d 61 6e 64 20 6c 69 | 6e 65 2e 20 54 68 69 73 |mmand li|ne. This|
|00001150| 20 69 73 20 66 6f 72 20 | 74 65 73 74 69 6e 67 0a | is for |testing.|
|00001160| 09 20 20 6f 6e 6c 79 20 | 61 6e 64 20 73 68 6f 75 |. only |and shou|
|00001170| 6c 64 20 62 65 20 72 65 | 6d 6f 76 65 64 20 62 65 |ld be re|moved be|
|00001180| 66 6f 72 65 20 74 68 65 | 20 67 65 6e 65 72 61 6c |fore the| general|
|00001190| 20 72 65 6c 65 61 73 65 | 2e 20 54 6f 20 65 6e 61 | release|. To ena|
|000011a0| 62 6c 65 2c 20 0a 09 20 | 20 63 6f 6d 70 69 6c 65 |ble, .. | compile|
|000011b0| 20 77 69 74 68 20 53 48 | 4f 57 43 4d 44 4c 49 4e | with SH|OWCMDLIN|
|000011c0| 45 20 64 65 66 69 6e 65 | 64 2e 0a 0a 09 33 30 20 |E define|d....30 |
|000011d0| 4a 55 4e 20 31 39 39 39 | 3a 0a 09 2b 20 4e 65 77 |JUN 1999|:..+ New|
|000011e0| 20 66 75 6e 63 74 69 6f | 6e 20 46 69 6e 64 55 6e | functio|n FindUn|
|000011f0| 71 75 6f 74 65 64 53 70 | 61 63 65 28 29 20 77 68 |quotedSp|ace() wh|
|00001200| 69 63 68 20 72 65 70 6c | 61 63 65 73 20 74 68 65 |ich repl|aces the|
|00001210| 20 65 61 72 6c 69 65 72 | 20 74 65 63 68 6e 69 71 | earlier| techniq|
|00001220| 75 65 20 66 6f 72 0a 09 | 20 20 66 69 6e 64 69 6e |ue for..| findin|
|00001230| 67 20 74 68 65 20 63 6f | 6d 6d 61 6e 64 20 6c 69 |g the co|mmand li|
|00001240| 6e 65 20 61 72 67 75 6d | 65 6e 74 73 20 74 6f 20 |ne argum|ents to |
|00001250| 73 65 6e 64 20 6f 6e 20 | 74 6f 20 77 67 6e 75 70 |send on |to wgnup|
|00001260| 6c 6f 74 2e 20 50 72 69 | 6f 72 20 74 6f 20 74 68 |lot. Pri|or to th|
|00001270| 69 73 0a 09 20 20 74 68 | 65 20 61 72 67 75 6d 65 |is.. th|e argume|
|00001280| 6e 74 73 20 77 65 72 65 | 20 61 73 73 75 6d 65 64 |nts were| assumed|
|00001290| 20 74 6f 20 73 74 61 72 | 74 20 61 66 74 65 72 20 | to star|t after |
|000012a0| 61 72 67 76 5b 30 5d 2c | 20 68 6f 77 65 76 65 72 |argv[0],| however|
|000012b0| 20 61 72 67 76 5b 30 5d | 20 69 73 20 6e 6f 74 0a | argv[0]| is not.|
|000012c0| 09 20 20 73 65 74 20 74 | 68 65 20 73 61 6d 65 20 |. set t|he same |
|000012d0| 62 79 20 61 6c 6c 20 63 | 6f 6d 62 69 6e 69 74 61 |by all c|ombinita|
|000012e0| 69 6f 6e 73 20 6f 66 20 | 63 6f 6d 70 69 6c 65 72 |ions of |compiler|
|000012f0| 2c 20 63 6f 6d 6d 61 6e | 64 20 70 72 6f 63 65 73 |, comman|d proces|
|00001300| 73 6f 72 2c 20 61 6e 64 | 20 4f 53 2e 20 0a 09 20 |sor, and| OS. .. |
|00001310| 20 54 68 65 20 6e 65 77 | 20 6d 65 74 68 6f 64 20 | The new| method |
|00001320| 69 67 6e 6f 72 65 73 20 | 61 72 67 76 20 63 6f 6d |ignores |argv com|
|00001330| 70 6c 65 74 65 6c 79 20 | 61 6e 64 20 6d 61 6e 75 |pletely |and manu|
|00001340| 61 6c 6c 79 20 73 65 61 | 72 63 68 20 74 68 65 20 |ally sea|rch the |
|00001350| 63 6f 6d 6d 61 6e 64 20 | 6c 69 6e 65 0a 09 20 20 |command |line.. |
|00001360| 73 74 72 69 6e 67 20 66 | 6f 72 20 74 68 65 20 66 |string f|or the f|
|00001370| 69 72 73 74 20 73 70 61 | 63 65 20 77 68 69 63 68 |irst spa|ce which|
|00001380| 20 69 73 6e 27 74 20 65 | 6e 63 6c 6f 73 65 64 20 | isn't e|nclosed |
|00001390| 69 6e 20 64 6f 75 62 6c | 65 2d 71 75 6f 74 65 73 |in doubl|e-quotes|
|000013a0| 2e 0a 0a 20 20 2a 2f 0a | 0a 23 69 6e 63 6c 75 64 |... */.|.#includ|
|000013b0| 65 20 3c 69 6f 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |e <io.h>|.#includ|
|000013c0| 65 20 3c 63 6f 6e 69 6f | 2e 68 3e 0a 23 69 6e 63 |e <conio|.h>.#inc|
|000013d0| 6c 75 64 65 20 3c 66 63 | 6e 74 6c 2e 68 3e 0a 23 |lude <fc|ntl.h>.#|
|000013e0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 69 6f 2e 68 |include |<stdio.h|
|000013f0| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 72 69 |>.#inclu|de <stri|
|00001400| 6e 67 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |ng.h>.#i|nclude <|
|00001410| 73 74 64 6c 69 62 2e 68 | 3e 0a 23 69 6e 63 6c 75 |stdlib.h|>.#inclu|
|00001420| 64 65 20 3c 77 69 6e 64 | 6f 77 73 2e 68 3e 0a 0a |de <wind|ows.h>..|
|00001430| 23 69 66 6e 64 65 66 20 | 5f 4f 5f 42 49 4e 41 52 |#ifndef |_O_BINAR|
|00001440| 59 0a 23 20 64 65 66 69 | 6e 65 20 5f 4f 5f 42 49 |Y.# defi|ne _O_BI|
|00001450| 4e 41 52 59 20 4f 5f 42 | 49 4e 41 52 59 0a 23 65 |NARY O_B|INARY.#e|
|00001460| 6e 64 69 66 0a 23 69 66 | 20 28 5f 5f 42 4f 52 4c |ndif.#if| (__BORL|
|00001470| 41 4e 44 43 5f 5f 20 3e | 3d 20 30 78 34 35 30 29 |ANDC__ >|= 0x450)|
|00001480| 20 2f 2a 20 61 62 6f 75 | 74 20 42 43 42 75 69 6c | /* abou|t BCBuil|
|00001490| 64 65 72 20 31 2e 30 20 | 2a 2f 0a 23 20 64 65 66 |der 1.0 |*/.# def|
|000014a0| 69 6e 65 20 5f 73 65 74 | 6d 6f 64 65 20 73 65 74 |ine _set|mode set|
|000014b0| 6d 6f 64 65 0a 23 65 6e | 64 69 66 0a 0a 2f 2a 20 |mode.#en|dif../* |
|000014c0| 43 75 73 74 6f 6d 69 7a | 65 20 74 68 69 73 20 70 |Customiz|e this p|
|000014d0| 61 74 68 20 69 66 20 6e | 65 65 64 65 64 20 2a 2f |ath if n|eeded */|
|000014e0| 0a 23 64 65 66 69 6e 65 | 20 50 52 4f 47 4e 41 4d |.#define| PROGNAM|
|000014f0| 45 20 22 77 67 6e 75 70 | 6c 6f 74 2e 65 78 65 22 |E "wgnup|lot.exe"|
|00001500| 0a 2f 2a 20 43 52 53 3a | 20 54 68 65 20 76 61 6c |./* CRS:| The val|
|00001510| 75 65 20 67 69 76 65 6e | 20 61 62 6f 76 65 20 77 |ue given| above w|
|00001520| 69 6c 6c 20 77 6f 72 6b | 20 63 6f 72 72 65 63 74 |ill work| correct|
|00001530| 6c 79 20 61 73 20 6c 6f | 6e 67 20 61 73 20 70 67 |ly as lo|ng as pg|
|00001540| 6e 75 70 6c 6f 74 2e 65 | 78 65 0a 20 2a 20 69 73 |nuplot.e|xe. * is|
|00001550| 20 69 6e 20 74 68 65 20 | 73 61 6d 65 20 64 69 72 | in the |same dir|
|00001560| 65 63 74 6f 72 79 20 61 | 73 20 77 67 6e 75 70 6c |ectory a|s wgnupl|
|00001570| 6f 74 2e 65 78 65 20 6f | 72 20 74 68 65 20 64 69 |ot.exe o|r the di|
|00001580| 72 65 63 74 6f 72 79 20 | 63 6f 6e 74 61 69 6e 69 |rectory |containi|
|00001590| 6e 67 0a 20 2a 20 77 67 | 6e 75 70 6c 6f 74 2e 65 |ng. * wg|nuplot.e|
|000015a0| 78 65 20 69 73 20 69 6e | 63 6c 75 64 65 64 20 69 |xe is in|cluded i|
|000015b0| 6e 20 74 68 65 20 70 61 | 74 68 2e 20 49 20 77 6f |n the pa|th. I wo|
|000015c0| 75 6c 64 20 72 65 63 6f | 6d 6d 65 6e 64 20 70 6c |uld reco|mmend pl|
|000015d0| 61 63 69 6e 67 20 74 68 | 65 20 0a 20 2a 20 70 67 |acing th|e . * pg|
|000015e0| 6e 75 70 6c 6f 74 2e 65 | 78 65 20 65 78 65 63 75 |nuplot.e|xe execu|
|000015f0| 74 61 62 6c 65 20 69 6e | 20 74 68 65 20 73 61 6d |table in| the sam|
|00001600| 65 20 64 69 72 65 63 74 | 6f 72 79 20 61 73 20 77 |e direct|ory as w|
|00001610| 67 6e 75 70 6c 6f 74 2e | 65 78 65 20 61 6e 64 20 |gnuplot.|exe and |
|00001620| 0a 20 2a 20 6c 65 61 76 | 69 6e 67 20 74 68 69 73 |. * leav|ing this|
|00001630| 20 64 65 66 69 6e 69 74 | 69 6f 6e 20 61 6c 6f 6e | definit|ion alon|
|00001640| 65 2e 0a 20 2a 2f 0a 0a | 23 64 65 66 69 6e 65 20 |e.. */..|#define |
|00001650| 57 49 4e 44 4f 57 4e 41 | 4d 45 20 22 67 6e 75 70 |WINDOWNA|ME "gnup|
|00001660| 6c 6f 74 22 0a 23 64 65 | 66 69 6e 65 20 50 41 52 |lot".#de|fine PAR|
|00001670| 45 4e 54 43 4c 41 53 53 | 20 22 77 67 6e 75 70 6c |ENTCLASS| "wgnupl|
|00001680| 6f 74 5f 70 61 72 65 6e | 74 22 0a 23 64 65 66 69 |ot_paren|t".#defi|
|00001690| 6e 65 20 54 45 58 54 43 | 4c 41 53 53 20 22 77 67 |ne TEXTC|LASS "wg|
|000016a0| 6e 75 70 6c 6f 74 5f 74 | 65 78 74 22 0a 23 64 65 |nuplot_t|ext".#de|
|000016b0| 66 69 6e 65 20 47 52 41 | 50 48 57 49 4e 44 4f 57 |fine GRA|PHWINDOW|
|000016c0| 20 22 67 6e 75 70 6c 6f | 74 20 67 72 61 70 68 22 | "gnuplo|t graph"|
|000016d0| 0a 23 64 65 66 69 6e 65 | 20 47 52 41 50 48 43 4c |.#define| GRAPHCL|
|000016e0| 41 53 53 20 22 77 67 6e | 75 70 6c 6f 74 5f 67 72 |ASS "wgn|uplot_gr|
|000016f0| 61 70 68 22 0a 23 64 65 | 66 69 6e 65 20 42 55 46 |aph".#de|fine BUF|
|00001700| 46 45 52 5f 53 49 5a 45 | 20 38 30 0a 0a 2f 2a 20 |FER_SIZE| 80../* |
|00001710| 47 4c 4f 42 41 4c 20 56 | 61 72 69 61 62 6c 65 73 |GLOBAL V|ariables|
|00001720| 20 2a 2f 0a 48 57 4e 44 | 20 68 77 6e 64 50 61 72 | */.HWND| hwndPar|
|00001730| 65 6e 74 20 3d 20 4e 55 | 4c 4c 3b 0a 48 57 4e 44 |ent = NU|LL;.HWND|
|00001740| 20 68 77 6e 64 54 65 78 | 74 20 3d 20 4e 55 4c 4c | hwndTex|t = NULL|
|00001750| 3b 0a 0a 50 52 4f 43 45 | 53 53 5f 49 4e 46 4f 52 |;..PROCE|SS_INFOR|
|00001760| 4d 41 54 49 4f 4e 20 70 | 69 50 72 6f 63 49 6e 66 |MATION p|iProcInf|
|00001770| 6f 3b 20 0a 53 54 41 52 | 54 55 50 49 4e 46 4f 20 |o; .STAR|TUPINFO |
|00001780| 20 20 20 20 20 20 20 20 | 73 69 53 74 61 72 74 49 | |siStartI|
|00001790| 6e 66 6f 3b 20 0a 0a 2f | 2a 20 43 52 53 3a 20 43 |nfo; ../|* CRS: C|
|000017a0| 61 6c 6c 62 61 63 6b 20 | 66 6f 72 20 74 68 65 20 |allback |for the |
|000017b0| 45 6e 75 6d 54 68 72 65 | 61 64 57 69 6e 64 6f 77 |EnumThre|adWindow|
|000017c0| 73 20 66 75 6e 63 74 69 | 6f 6e 20 2a 2f 0a 42 4f |s functi|on */.BO|
|000017d0| 4f 4c 20 43 41 4c 4c 42 | 41 43 4b 20 63 62 47 65 |OL CALLB|ACK cbGe|
|000017e0| 74 54 65 78 74 57 69 6e | 64 6f 77 28 48 57 4e 44 |tTextWin|dow(HWND|
|000017f0| 20 20 68 77 6e 64 2c 20 | 4c 50 41 52 41 4d 20 20 | hwnd, |LPARAM |
|00001800| 6c 50 61 72 61 6d 20 29 | 0a 7b 0a 09 2f 2a 20 73 |lParam )|.{../* s|
|00001810| 61 76 65 20 74 68 65 20 | 76 61 6c 75 65 20 6f 66 |ave the |value of|
|00001820| 20 74 68 65 20 70 61 72 | 65 6e 74 20 77 69 6e 64 | the par|ent wind|
|00001830| 6f 77 20 2a 2f 0a 09 68 | 77 6e 64 50 61 72 65 6e |ow */..h|wndParen|
|00001840| 74 20 3d 20 68 77 6e 64 | 3b 0a 09 2f 2a 20 63 68 |t = hwnd|;../* ch|
|00001850| 65 63 6b 20 74 6f 20 73 | 65 65 20 69 66 20 69 74 |eck to s|ee if it|
|00001860| 20 68 61 73 20 61 20 63 | 68 69 6c 64 20 74 65 78 | has a c|hild tex|
|00001870| 74 20 77 69 6e 64 6f 77 | 20 2a 2f 0a 09 68 77 6e |t window| */..hwn|
|00001880| 64 54 65 78 74 20 3d 20 | 46 69 6e 64 57 69 6e 64 |dText = |FindWind|
|00001890| 6f 77 45 78 28 68 77 6e | 64 2c 20 4e 55 4c 4c 2c |owEx(hwn|d, NULL,|
|000018a0| 20 54 45 58 54 43 4c 41 | 53 53 2c 20 4e 55 4c 4c | TEXTCLA|SS, NULL|
|000018b0| 20 29 3b 0a 0a 09 2f 2a | 20 69 66 20 74 68 65 20 | );.../*| if the |
|000018c0| 74 65 78 74 20 77 69 6e | 64 6f 77 20 77 61 73 20 |text win|dow was |
|000018d0| 66 6f 75 6e 64 2c 20 73 | 74 6f 70 20 6c 6f 6f 6b |found, s|top look|
|000018e0| 69 6e 67 20 2a 2f 0a 09 | 72 65 74 75 72 6e 20 28 |ing */..|return (|
|000018f0| 20 68 77 6e 64 54 65 78 | 74 20 21 3d 20 4e 55 4c | hwndTex|t != NUL|
|00001900| 4c 20 29 3b 0a 7d 0a 0a | 2f 2a 20 73 65 6e 64 73 |L );.}..|/* sends|
|00001910| 20 61 20 73 74 72 69 6e | 67 20 74 6f 20 74 68 65 | a strin|g to the|
|00001920| 20 73 70 65 63 69 66 69 | 65 64 20 77 69 6e 64 6f | specifi|ed windo|
|00001930| 77 20 2a 2f 0a 2f 2a 20 | 43 52 53 3a 20 6d 61 64 |w */./* |CRS: mad|
|00001940| 65 20 74 68 69 73 20 69 | 6e 74 6f 20 61 20 66 75 |e this i|nto a fu|
|00001950| 6e 63 74 69 6f 6e 20 63 | 61 6c 6c 20 2a 2f 0a 76 |nction c|all */.v|
|00001960| 6f 69 64 20 50 6f 73 74 | 53 74 72 69 6e 67 28 48 |oid Post|String(H|
|00001970| 57 4e 44 20 68 77 6e 64 | 2c 20 63 68 61 72 20 2a |WND hwnd|, char *|
|00001980| 70 63 29 0a 7b 0a 09 77 | 68 69 6c 65 28 20 2a 70 |pc).{..w|hile( *p|
|00001990| 63 20 29 7b 0a 09 09 50 | 6f 73 74 4d 65 73 73 61 |c ){...P|ostMessa|
|000019a0| 67 65 28 20 68 77 6e 64 | 2c 20 57 4d 5f 43 48 41 |ge( hwnd|, WM_CHA|
|000019b0| 52 2c 20 2a 70 63 2c 20 | 31 4c 20 29 3b 0a 09 09 |R, *pc, |1L );...|
|000019c0| 2f 2a 20 43 52 53 3a 20 | 73 68 6f 75 6c 64 20 61 |/* CRS: |should a|
|000019d0| 64 64 20 61 20 63 68 65 | 63 6b 20 6f 66 20 72 65 |dd a che|ck of re|
|000019e0| 74 75 72 6e 20 63 6f 64 | 65 20 6f 6e 20 50 6f 73 |turn cod|e on Pos|
|000019f0| 74 4d 65 73 73 61 67 65 | 2e 20 49 66 20 30 2c 20 |tMessage|. If 0, |
|00001a00| 74 68 65 20 0a 09 09 20 | 20 20 6d 65 73 73 61 67 |the ... | messag|
|00001a10| 65 20 71 75 65 20 77 61 | 73 20 66 75 6c 6c 20 61 |e que wa|s full a|
|00001a20| 6e 64 20 74 68 65 20 6d | 65 73 73 61 67 65 20 77 |nd the m|essage w|
|00001a30| 61 73 6e 27 74 20 70 6f | 73 74 65 64 2e 20 2a 2f |asn't po|sted. */|
|00001a40| 0a 09 09 70 63 2b 2b 3b | 0a 09 7d 0a 7d 0a 0a 2f |...pc++;|..}.}../|
|00001a50| 2a 20 46 69 6e 64 55 6e | 71 75 6f 74 65 64 53 70 |* FindUn|quotedSp|
|00001a60| 61 63 65 28 29 3a 20 53 | 65 61 72 63 68 20 61 20 |ace(): S|earch a |
|00001a70| 73 74 72 69 6e 67 20 66 | 6f 72 20 74 68 65 20 66 |string f|or the f|
|00001a80| 69 72 73 74 20 73 70 61 | 63 65 20 6e 6f 74 20 65 |irst spa|ce not e|
|00001a90| 6e 63 6c 6f 73 65 64 20 | 69 6e 20 71 75 6f 74 65 |nclosed |in quote|
|00001aa0| 73 2e 0a 20 2a 20 20 20 | 52 65 74 75 72 6e 73 20 |s.. * |Returns |
|00001ab0| 61 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |a pointe|r to the|
|00001ac0| 20 73 70 61 63 65 2c 20 | 6f 72 20 74 68 65 20 65 | space, |or the e|
|00001ad0| 6d 70 74 79 20 73 74 72 | 69 6e 67 20 69 66 20 6e |mpty str|ing if n|
|00001ae0| 6f 20 73 70 61 63 65 20 | 69 73 20 66 6f 75 6e 64 |o space |is found|
|00001af0| 2e 20 0a 20 2a 20 20 20 | 2d 43 52 53 20 33 30 30 |. . * |-CRS 300|
|00001b00| 36 31 39 39 39 20 20 0a | 20 2a 2f 0a 63 68 61 72 |61999 .| */.char|
|00001b10| 2a 20 46 69 6e 64 55 6e | 71 75 6f 74 65 64 53 70 |* FindUn|quotedSp|
|00001b20| 61 63 65 28 20 63 68 61 | 72 20 2a 70 63 20 29 0a |ace( cha|r *pc ).|
|00001b30| 7b 0a 09 77 68 69 6c 65 | 20 28 20 28 2a 70 63 29 |{..while| ( (*pc)|
|00001b40| 20 26 26 20 28 2a 70 63 | 20 21 3d 20 27 20 27 29 | && (*pc| != ' ')|
|00001b50| 20 26 26 20 28 2a 70 63 | 20 21 3d 20 27 5c 74 27 | && (*pc| != '\t'|
|00001b60| 29 20 29 7b 0a 09 09 69 | 66 20 28 20 2a 70 63 20 |) ){...i|f ( *pc |
|00001b70| 3d 3d 20 27 22 27 20 29 | 7b 0a 09 09 09 64 6f 20 |== '"' )|{....do |
|00001b80| 7b 0a 09 09 09 09 70 63 | 2b 2b 3b 0a 09 09 09 7d |{.....pc|++;....}|
|00001b90| 20 77 68 69 6c 65 20 28 | 20 28 70 63 5b 31 5d 29 | while (| (pc[1])|
|00001ba0| 20 26 26 20 28 2a 70 63 | 20 21 3d 20 27 22 27 29 | && (*pc| != '"')|
|00001bb0| 20 29 3b 0a 09 09 7d 0a | 09 09 70 63 2b 2b 3b 0a | );...}.|..pc++;.|
|00001bc0| 09 7d 0a 09 72 65 74 75 | 72 6e 20 70 63 3b 0a 7d |.}..retu|rn pc;.}|
|00001bd0| 0a 0a 69 6e 74 20 6d 61 | 69 6e 20 28 69 6e 74 20 |..int ma|in (int |
|00001be0| 61 72 67 63 2c 20 63 68 | 61 72 20 2a 61 72 67 76 |argc, ch|ar *argv|
|00001bf0| 5b 5d 29 0a 7b 0a 09 63 | 68 61 72 20 20 20 20 70 |[]).{..c|har p|
|00001c00| 73 42 75 66 66 65 72 5b | 42 55 46 46 45 52 5f 53 |sBuffer[|BUFFER_S|
|00001c10| 49 5a 45 5d 3b 0a 09 63 | 68 61 72 20 20 20 20 70 |IZE];..c|har p|
|00001c20| 73 47 6e 75 70 6c 6f 74 | 43 6f 6d 6d 61 6e 64 4c |sGnuplot|CommandL|
|00001c30| 69 6e 65 5b 4d 41 58 5f | 50 41 54 48 5d 20 3d 20 |ine[MAX_|PATH] = |
|00001c40| 50 52 4f 47 4e 41 4d 45 | 3b 0a 09 4c 50 54 53 54 |PROGNAME|;..LPTST|
|00001c50| 52 20 20 70 73 43 6d 64 | 4c 69 6e 65 3b 0a 09 42 |R psCmd|Line;..B|
|00001c60| 4f 4f 4c 20 20 20 20 62 | 53 75 63 63 65 73 73 3b |OOL b|Success;|
|00001c70| 0a 09 0a 09 2f 2a 20 48 | 42 42 20 31 39 39 39 30 |..../* H|BB 19990|
|00001c80| 33 32 35 2c 20 74 6f 20 | 61 6c 6c 6f 77 20 70 67 |325, to |allow pg|
|00001c90| 6e 75 70 6c 6f 74 20 3c | 20 73 63 72 69 70 74 20 |nuplot <| script |
|00001ca0| 3e 20 6f 75 74 70 75 74 | 2e 67 69 66 20 2a 2f 0a |> output|.gif */.|
|00001cb0| 09 5f 73 65 74 6d 6f 64 | 65 28 66 69 6c 65 6e 6f |._setmod|e(fileno|
|00001cc0| 28 73 74 64 6f 75 74 29 | 2c 20 5f 4f 5f 42 49 4e |(stdout)|, _O_BIN|
|00001cd0| 41 52 59 29 3b 0a 0a 09 | 2f 2a 20 43 52 53 3a 20 |ARY);...|/* CRS: |
|00001ce0| 63 72 65 61 74 65 20 74 | 68 65 20 6e 65 77 20 63 |create t|he new c|
|00001cf0| 6f 6d 6d 61 6e 64 20 6c | 69 6e 65 2c 20 70 61 73 |ommand l|ine, pas|
|00001d00| 73 69 6e 67 20 61 6c 6c | 20 6f 66 20 74 68 65 20 |sing all| of the |
|00001d10| 63 6f 6d 6d 61 6e 64 0a | 09 20 2a 20 6c 69 6e 65 |command.|. * line|
|00001d20| 20 6f 70 74 69 6f 6e 73 | 20 74 6f 20 77 67 6e 75 | options| to wgnu|
|00001d30| 70 6c 6f 74 20 73 6f 20 | 74 68 61 74 20 69 74 20 |plot so |that it |
|00001d40| 63 61 6e 20 70 72 6f 63 | 65 73 73 20 74 68 65 6d |can proc|ess them|
|00001d50| 3a 0a 09 20 2a 20 66 69 | 72 73 74 2c 20 67 65 74 |:.. * fi|rst, get|
|00001d60| 20 74 68 65 20 63 6f 6d | 6d 61 6e 64 20 6c 69 6e | the com|mand lin|
|00001d70| 65 2c 0a 09 20 2a 20 74 | 68 65 6e 20 6d 6f 76 65 |e,.. * t|hen move|
|00001d80| 20 70 61 73 74 20 74 68 | 65 20 6e 61 6d 65 20 6f | past th|e name o|
|00001d90| 66 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 28 65 |f the pr|ogram (e|
|00001da0| 2e 67 2e 2c 20 27 70 67 | 6e 75 70 6c 6f 74 27 29 |.g., 'pg|nuplot')|
|00001db0| 2c 0a 09 20 2a 20 66 69 | 6e 61 6c 6c 79 2c 20 61 |,.. * fi|nally, a|
|00001dc0| 64 64 20 77 68 61 74 27 | 73 20 6c 65 66 74 20 6f |dd what'|s left o|
|00001dd0| 66 20 74 68 65 20 6c 69 | 6e 65 20 6f 6e 74 6f 20 |f the li|ne onto |
|00001de0| 74 68 65 20 67 6e 75 70 | 6c 6f 74 20 63 6f 6d 6d |the gnup|lot comm|
|00001df0| 61 6e 64 20 6c 69 6e 65 | 2e 20 2a 2f 0a 09 70 73 |and line|. */..ps|
|00001e00| 43 6d 64 4c 69 6e 65 20 | 3d 20 47 65 74 43 6f 6d |CmdLine |= GetCom|
|00001e10| 6d 61 6e 64 4c 69 6e 65 | 28 29 3b 0a 0a 23 69 66 |mandLine|();..#if|
|00001e20| 64 65 66 20 53 48 4f 57 | 43 4d 44 4c 49 4e 45 0a |def SHOW|CMDLINE.|
|00001e30| 09 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c |.fprintf|(stderr,|
|00001e40| 22 43 6d 64 4c 69 6e 65 | 3a 20 25 73 5c 6e 22 2c |"CmdLine|: %s\n",|
|00001e50| 20 70 73 43 6d 64 4c 69 | 6e 65 29 3b 0a 09 66 70 | psCmdLi|ne);..fp|
|00001e60| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 22 61 72 |rintf(st|derr,"ar|
|00001e70| 67 76 5b 30 5d 3a 20 25 | 73 5c 6e 22 2c 61 72 67 |gv[0]: %|s\n",arg|
|00001e80| 76 5b 30 5d 29 3b 0a 23 | 65 6e 64 69 66 0a 0a 09 |v[0]);.#|endif...|
|00001e90| 2f 2a 20 43 52 53 20 33 | 30 30 36 31 39 39 39 3a |/* CRS 3|0061999:|
|00001ea0| 20 53 65 61 72 63 68 20 | 66 6f 72 20 74 68 65 20 | Search |for the |
|00001eb0| 66 69 72 73 74 20 75 6e | 71 75 6f 74 65 64 20 73 |first un|quoted s|
|00001ec0| 70 61 63 65 2e 20 54 68 | 69 73 20 73 68 6f 75 6c |pace. Th|is shoul|
|00001ed0| 64 20 0a 09 20 20 20 73 | 65 70 61 72 61 74 65 20 |d .. s|eparate |
|00001ee0| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 6e 61 6d 65 |the prog|ram name|
|00001ef0| 20 66 72 6f 6d 20 74 68 | 65 20 61 72 67 75 6d 65 | from th|e argume|
|00001f00| 6e 74 73 2e 20 2a 2f 0a | 09 70 73 43 6d 64 4c 69 |nts. */.|.psCmdLi|
|00001f10| 6e 65 20 3d 20 46 69 6e | 64 55 6e 71 75 6f 74 65 |ne = Fin|dUnquote|
|00001f20| 64 53 70 61 63 65 28 20 | 70 73 43 6d 64 4c 69 6e |dSpace( |psCmdLin|
|00001f30| 65 20 29 3b 0a 0a 09 73 | 74 72 6e 63 61 74 28 70 |e );...s|trncat(p|
|00001f40| 73 47 6e 75 70 6c 6f 74 | 43 6f 6d 6d 61 6e 64 4c |sGnuplot|CommandL|
|00001f50| 69 6e 65 2c 20 70 73 43 | 6d 64 4c 69 6e 65 2c 20 |ine, psC|mdLine, |
|00001f60| 4d 41 58 5f 50 41 54 48 | 20 2d 20 73 74 72 6c 65 |MAX_PATH| - strle|
|00001f70| 6e 28 70 73 47 6e 75 70 | 6c 6f 74 43 6f 6d 6d 61 |n(psGnup|lotComma|
|00001f80| 6e 64 4c 69 6e 65 29 29 | 3b 0a 0a 23 69 66 64 65 |ndLine))|;..#ifde|
|00001f90| 66 20 53 48 4f 57 43 4d | 44 4c 49 4e 45 0a 09 66 |f SHOWCM|DLINE..f|
|00001fa0| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 22 41 |printf(s|tderr,"A|
|00001fb0| 72 67 75 6d 65 6e 74 73 | 3a 20 25 73 5c 6e 22 2c |rguments|: %s\n",|
|00001fc0| 20 70 73 43 6d 64 4c 69 | 6e 65 29 3b 0a 09 66 70 | psCmdLi|ne);..fp|
|00001fd0| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 22 47 6e |rintf(st|derr,"Gn|
|00001fe0| 75 70 6c 6f 74 43 6f 6d | 6d 61 6e 64 4c 69 6e 65 |uplotCom|mandLine|
|00001ff0| 3a 20 25 73 5c 6e 22 2c | 70 73 47 6e 75 70 6c 6f |: %s\n",|psGnuplo|
|00002000| 74 43 6f 6d 6d 61 6e 64 | 4c 69 6e 65 29 3b 0a 23 |tCommand|Line);.#|
|00002010| 65 6e 64 69 66 0a 0a 09 | 2f 2a 20 43 52 53 3a 20 |endif...|/* CRS: |
|00002020| 69 66 20 73 74 64 69 6e | 20 69 73 6e 27 74 20 72 |if stdin| isn't r|
|00002030| 65 64 69 72 65 63 74 65 | 64 20 74 68 65 6e 20 6a |edirecte|d then j|
|00002040| 75 73 74 20 6c 61 75 6e | 63 68 20 77 67 6e 75 70 |ust laun|ch wgnup|
|00002050| 6c 6f 74 20 6e 6f 72 6d | 61 6c 6c 79 0a 09 20 2a |lot norm|ally.. *|
|00002060| 20 61 6e 64 20 65 78 69 | 74 2e 20 2a 2f 0a 09 69 | and exi|t. */..i|
|00002070| 66 20 28 20 69 73 61 74 | 74 79 28 66 69 6c 65 6e |f ( isat|ty(filen|
|00002080| 6f 28 73 74 64 69 6e 29 | 29 20 29 20 7b 0a 09 09 |o(stdin)|) ) {...|
|00002090| 69 66 20 28 20 57 69 6e | 45 78 65 63 28 70 73 47 |if ( Win|Exec(psG|
|000020a0| 6e 75 70 6c 6f 74 43 6f | 6d 6d 61 6e 64 4c 69 6e |nuplotCo|mmandLin|
|000020b0| 65 2c 20 53 57 5f 53 48 | 4f 57 44 45 46 41 55 4c |e, SW_SH|OWDEFAUL|
|000020c0| 54 29 20 3e 20 33 31 20 | 29 7b 0a 09 09 09 65 78 |T) > 31 |){....ex|
|000020d0| 69 74 28 45 58 49 54 5f | 53 55 43 43 45 53 53 29 |it(EXIT_|SUCCESS)|
|000020e0| 3b 0a 09 09 7d 0a 09 09 | 66 70 72 69 6e 74 66 28 |;...}...|fprintf(|
|000020f0| 73 74 64 65 72 72 2c 22 | 45 52 52 4f 52 20 25 75 |stderr,"|ERROR %u|
|00002100| 3a 20 43 6f 75 6c 64 6e | 27 74 20 65 78 65 63 75 |: Couldn|'t execu|
|00002110| 74 65 3a 20 5c 22 25 73 | 5c 22 5c 6e 22 2c 20 0a |te: \"%s|\"\n", .|
|00002120| 09 09 09 20 20 20 20 47 | 65 74 4c 61 73 74 45 72 |... G|etLastEr|
|00002130| 72 6f 72 28 29 2c 20 70 | 73 47 6e 75 70 6c 6f 74 |ror(), p|sGnuplot|
|00002140| 43 6f 6d 6d 61 6e 64 4c | 69 6e 65 29 3b 0a 09 09 |CommandL|ine);...|
|00002150| 65 78 69 74 28 45 58 49 | 54 5f 46 41 49 4c 55 52 |exit(EXI|T_FAILUR|
|00002160| 45 29 3b 0a 09 7d 0a 0a | 09 2f 2a 20 43 52 53 3a |E);..}..|./* CRS:|
|00002170| 20 69 6e 69 74 69 61 6c | 69 7a 65 20 74 68 65 20 | initial|ize the |
|00002180| 53 54 41 52 54 55 50 49 | 4e 46 4f 20 61 6e 64 20 |STARTUPI|NFO and |
|00002190| 63 61 6c 6c 20 43 72 65 | 61 74 65 50 72 6f 63 65 |call Cre|ateProce|
|000021a0| 73 73 28 29 2e 20 2a 2f | 20 0a 09 73 69 53 74 61 |ss(). */| ..siSta|
|000021b0| 72 74 49 6e 66 6f 2e 63 | 62 20 3d 20 73 69 7a 65 |rtInfo.c|b = size|
|000021c0| 6f 66 28 53 54 41 52 54 | 55 50 49 4e 46 4f 29 3b |of(START|UPINFO);|
|000021d0| 20 0a 09 73 69 53 74 61 | 72 74 49 6e 66 6f 2e 6c | ..siSta|rtInfo.l|
|000021e0| 70 52 65 73 65 72 76 65 | 64 20 3d 20 4e 55 4c 4c |pReserve|d = NULL|
|000021f0| 3b 20 0a 09 73 69 53 74 | 61 72 74 49 6e 66 6f 2e |; ..siSt|artInfo.|
|00002200| 6c 70 52 65 73 65 72 76 | 65 64 32 20 3d 20 4e 55 |lpReserv|ed2 = NU|
|00002210| 4c 4c 3b 20 0a 09 73 69 | 53 74 61 72 74 49 6e 66 |LL; ..si|StartInf|
|00002220| 6f 2e 63 62 52 65 73 65 | 72 76 65 64 32 20 3d 20 |o.cbRese|rved2 = |
|00002230| 30 3b 20 0a 09 73 69 53 | 74 61 72 74 49 6e 66 6f |0; ..siS|tartInfo|
|00002240| 2e 6c 70 44 65 73 6b 74 | 6f 70 20 3d 20 4e 55 4c |.lpDeskt|op = NUL|
|00002250| 4c 3b 20 0a 09 73 69 53 | 74 61 72 74 49 6e 66 6f |L; ..siS|tartInfo|
|00002260| 2e 64 77 46 6c 61 67 73 | 20 3d 20 53 54 41 52 54 |.dwFlags| = START|
|00002270| 46 5f 55 53 45 53 48 4f | 57 57 49 4e 44 4f 57 3b |F_USESHO|WWINDOW;|
|00002280| 0a 09 73 69 53 74 61 72 | 74 49 6e 66 6f 2e 77 53 |..siStar|tInfo.wS|
|00002290| 68 6f 77 57 69 6e 64 6f | 77 20 3d 20 53 57 5f 53 |howWindo|w = SW_S|
|000022a0| 48 4f 57 4d 49 4e 49 4d | 49 5a 45 44 3b 0a 0a 09 |HOWMINIM|IZED;...|
|000022b0| 62 53 75 63 63 65 73 73 | 20 3d 20 43 72 65 61 74 |bSuccess| = Creat|
|000022c0| 65 50 72 6f 63 65 73 73 | 28 20 0a 09 09 09 4e 55 |eProcess|( ....NU|
|000022d0| 4c 4c 2c 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |LL, | |
|000022e0| 20 20 20 20 20 20 2f 2a | 20 70 6f 69 6e 74 65 72 | /*| pointer|
|000022f0| 20 74 6f 20 6e 61 6d 65 | 20 6f 66 20 65 78 65 63 | to name| of exec|
|00002300| 75 74 61 62 6c 65 20 6d | 6f 64 75 6c 65 20 20 20 |utable m|odule |
|00002310| 2a 2f 0a 09 09 09 70 73 | 47 6e 75 70 6c 6f 74 43 |*/....ps|GnuplotC|
|00002320| 6f 6d 6d 61 6e 64 4c 69 | 6e 65 2c 20 20 20 2f 2a |ommandLi|ne, /*|
|00002330| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 63 6f 6d 6d | pointer| to comm|
|00002340| 61 6e 64 20 6c 69 6e 65 | 20 73 74 72 69 6e 67 20 |and line| string |
|00002350| 20 20 20 20 20 20 20 20 | 2a 2f 0a 09 09 09 4e 55 | |*/....NU|
|00002360| 4c 4c 2c 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |LL, | |
|00002370| 20 20 20 20 20 20 2f 2a | 20 70 6f 69 6e 74 65 72 | /*| pointer|
|00002380| 20 74 6f 20 70 72 6f 63 | 65 73 73 20 73 65 63 75 | to proc|ess secu|
|00002390| 72 69 74 79 20 61 74 74 | 72 69 62 75 74 65 73 20 |rity att|ributes |
|000023a0| 2a 2f 0a 09 09 09 4e 55 | 4c 4c 2c 20 20 20 20 20 |*/....NU|LL, |
|000023b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|000023c0| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 74 68 72 65 | pointer| to thre|
|000023d0| 61 64 20 73 65 63 75 72 | 69 74 79 20 61 74 74 72 |ad secur|ity attr|
|000023e0| 69 62 75 74 65 73 20 20 | 2a 2f 0a 09 09 09 46 41 |ibutes |*/....FA|
|000023f0| 4c 53 45 2c 20 20 20 20 | 20 20 20 20 20 20 20 20 |LSE, | |
|00002400| 20 20 20 20 20 20 2f 2a | 20 68 61 6e 64 6c 65 20 | /*| handle |
|00002410| 69 6e 68 65 72 69 74 61 | 6e 63 65 20 66 6c 61 67 |inherita|nce flag|
|00002420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002430| 2a 2f 0a 09 09 09 30 2c | 20 20 20 20 20 20 20 20 |*/....0,| |
|00002440| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00002450| 20 63 72 65 61 74 69 6f | 6e 20 66 6c 61 67 73 20 | creatio|n flags |
|00002460| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002470| 20 20 20 20 20 20 20 20 | 2a 2f 0a 09 09 09 4e 55 | |*/....NU|
|00002480| 4c 4c 2c 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |LL, | |
|00002490| 20 20 20 20 20 20 2f 2a | 20 70 6f 69 6e 74 65 72 | /*| pointer|
|000024a0| 20 74 6f 20 6e 65 77 20 | 65 6e 76 69 72 6f 6e 6d | to new |environm|
|000024b0| 65 6e 74 20 62 6c 6f 63 | 6b 20 20 20 20 20 20 20 |ent bloc|k |
|000024c0| 2a 2f 0a 09 09 09 4e 55 | 4c 4c 2c 20 20 20 20 20 |*/....NU|LL, |
|000024d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|000024e0| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 63 75 72 72 | pointer| to curr|
|000024f0| 65 6e 74 20 64 69 72 65 | 63 74 6f 72 79 20 6e 61 |ent dire|ctory na|
|00002500| 6d 65 20 20 20 20 20 20 | 2a 2f 0a 09 09 09 26 73 |me |*/....&s|
|00002510| 69 53 74 61 72 74 49 6e | 66 6f 2c 20 20 20 20 20 |iStartIn|fo, |
|00002520| 20 20 20 20 20 20 2f 2a | 20 70 6f 69 6e 74 65 72 | /*| pointer|
|00002530| 20 74 6f 20 53 54 41 52 | 54 55 50 49 4e 46 4f 20 | to STAR|TUPINFO |
|00002540| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002550| 2a 2f 0a 09 09 09 26 70 | 69 50 72 6f 63 49 6e 66 |*/....&p|iProcInf|
|00002560| 6f 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a |o | /*|
|00002570| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 50 52 4f 43 | pointer| to PROC|
|00002580| 45 53 53 5f 49 4e 46 4f | 52 4d 41 54 49 4f 4e 20 |ESS_INFO|RMATION |
|00002590| 20 20 20 20 20 20 20 20 | 2a 2f 0a 09 09 09 29 3b | |*/....);|
|000025a0| 0a 0a 09 2f 2a 20 69 66 | 20 43 72 65 61 74 65 50 |.../* if| CreateP|
|000025b0| 72 6f 63 65 73 73 28 29 | 20 66 61 69 6c 65 64 2c |rocess()| failed,|
|000025c0| 20 70 72 69 6e 74 20 61 | 20 77 61 72 6e 69 6e 67 | print a| warning|
|000025d0| 20 61 6e 64 20 65 78 69 | 74 2e 20 2a 2f 0a 09 69 | and exi|t. */..i|
|000025e0| 66 20 28 20 21 20 62 53 | 75 63 63 65 73 73 20 29 |f ( ! bS|uccess )|
|000025f0| 20 7b 0a 09 09 66 70 72 | 69 6e 74 66 28 73 74 64 | {...fpr|intf(std|
|00002600| 65 72 72 2c 22 45 52 52 | 4f 52 20 25 75 3a 20 43 |err,"ERR|OR %u: C|
|00002610| 6f 75 6c 64 6e 27 74 20 | 65 78 65 63 75 74 65 3a |ouldn't |execute:|
|00002620| 20 5c 22 25 73 5c 22 5c | 6e 22 2c 20 0a 09 09 09 | \"%s\"\|n", ....|
|00002630| 09 09 09 47 65 74 4c 61 | 73 74 45 72 72 6f 72 28 |...GetLa|stError(|
|00002640| 29 2c 20 70 73 47 6e 75 | 70 6c 6f 74 43 6f 6d 6d |), psGnu|plotComm|
|00002650| 61 6e 64 4c 69 6e 65 29 | 3b 0a 09 09 65 78 69 74 |andLine)|;...exit|
|00002660| 28 45 58 49 54 5f 46 41 | 49 4c 55 52 45 29 3b 0a |(EXIT_FA|ILURE);.|
|00002670| 09 7d 0a 0a 09 2f 2a 20 | 43 52 53 3a 20 67 69 76 |.}.../* |CRS: giv|
|00002680| 65 20 67 6e 75 70 6c 6f | 74 20 65 6e 6f 75 67 68 |e gnuplo|t enough|
|00002690| 20 74 69 6d 65 20 74 6f | 20 73 74 61 72 74 20 28 | time to| start (|
|000026a0| 31 20 73 65 63 2e 29 20 | 2a 2f 0a 09 69 66 20 28 |1 sec.) |*/..if (|
|000026b0| 20 57 61 69 74 46 6f 72 | 49 6e 70 75 74 49 64 6c | WaitFor|InputIdl|
|000026c0| 65 28 70 69 50 72 6f 63 | 49 6e 66 6f 2e 68 50 72 |e(piProc|Info.hPr|
|000026d0| 6f 63 65 73 73 2c 20 31 | 30 30 30 29 20 29 20 7b |ocess, 1|000) ) {|
|000026e0| 0a 09 09 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |...fprin|tf(stder|
|000026f0| 72 2c 20 22 54 69 6d 65 | 6f 75 74 3a 20 67 6e 75 |r, "Time|out: gnu|
|00002700| 70 6c 6f 74 20 69 73 20 | 6e 6f 74 20 72 65 61 64 |plot is |not read|
|00002710| 79 5c 6e 22 29 3b 0a 09 | 09 65 78 69 74 28 45 58 |y\n");..|.exit(EX|
|00002720| 49 54 5f 46 41 49 4c 55 | 52 45 29 3b 0a 09 7d 0a |IT_FAILU|RE);..}.|
|00002730| 0a 09 2f 2a 20 43 52 53 | 3a 20 67 65 74 20 74 68 |../* CRS|: get th|
|00002740| 65 20 48 57 4e 44 20 6f | 66 20 74 68 65 20 70 61 |e HWND o|f the pa|
|00002750| 72 65 6e 74 20 77 69 6e | 64 6f 77 20 61 6e 64 20 |rent win|dow and |
|00002760| 74 65 78 74 20 77 69 6e | 64 6f 77 73 20 2a 2f 0a |text win|dows */.|
|00002770| 09 45 6e 75 6d 54 68 72 | 65 61 64 57 69 6e 64 6f |.EnumThr|eadWindo|
|00002780| 77 73 28 70 69 50 72 6f | 63 49 6e 66 6f 2e 64 77 |ws(piPro|cInfo.dw|
|00002790| 54 68 72 65 61 64 49 64 | 2c 20 63 62 47 65 74 54 |ThreadId|, cbGetT|
|000027a0| 65 78 74 57 69 6e 64 6f | 77 2c 20 30 29 3b 0a 0a |extWindo|w, 0);..|
|000027b0| 09 2f 2a 20 43 52 53 3a | 20 66 72 65 65 20 74 68 |./* CRS:| free th|
|000027c0| 65 20 70 72 6f 63 65 73 | 73 20 61 6e 64 20 74 68 |e proces|s and th|
|000027d0| 72 65 61 64 20 68 61 6e | 64 6c 65 73 20 2a 2f 0a |read han|dles */.|
|000027e0| 09 43 6c 6f 73 65 48 61 | 6e 64 6c 65 28 70 69 50 |.CloseHa|ndle(piP|
|000027f0| 72 6f 63 49 6e 66 6f 2e | 68 50 72 6f 63 65 73 73 |rocInfo.|hProcess|
|00002800| 29 3b 0a 09 43 6c 6f 73 | 65 48 61 6e 64 6c 65 28 |);..Clos|eHandle(|
|00002810| 70 69 50 72 6f 63 49 6e | 66 6f 2e 68 54 68 72 65 |piProcIn|fo.hThre|
|00002820| 61 64 29 3b 0a 0a 09 69 | 66 20 28 20 21 20 68 77 |ad);...i|f ( ! hw|
|00002830| 6e 64 50 61 72 65 6e 74 | 20 7c 7c 20 21 20 68 77 |ndParent| || ! hw|
|00002840| 6e 64 54 65 78 74 20 29 | 20 7b 0a 09 2f 2a 20 53 |ndText )| {../* S|
|00002850| 74 69 6c 6c 20 6e 6f 20 | 67 6e 75 70 6c 6f 74 20 |till no |gnuplot |
|00002860| 77 69 6e 64 6f 77 3f 20 | 50 72 6f 62 6c 65 6d 21 |window? |Problem!|
|00002870| 20 2a 2f 0a 09 09 66 70 | 72 69 6e 74 66 28 73 74 | */...fp|rintf(st|
|00002880| 64 65 72 72 2c 20 22 43 | 61 6e 27 74 20 66 69 6e |derr, "C|an't fin|
|00002890| 64 20 74 68 65 20 67 6e | 75 70 6c 6f 74 20 77 69 |d the gn|uplot wi|
|000028a0| 6e 64 6f 77 22 29 3b 0a | 09 09 65 78 69 74 28 45 |ndow");.|..exit(E|
|000028b0| 58 49 54 5f 46 41 49 4c | 55 52 45 29 3b 0a 09 7d |XIT_FAIL|URE);..}|
|000028c0| 0a 0a 09 2f 2a 20 77 61 | 69 74 20 66 6f 72 20 63 |.../* wa|it for c|
|000028d0| 6f 6d 6d 61 6e 64 73 20 | 6f 6e 20 73 74 64 69 6e |ommands |on stdin|
|000028e0| 2c 20 61 6e 64 20 70 61 | 73 73 20 74 68 65 6d 20 |, and pa|ss them |
|000028f0| 6f 6e 20 74 6f 20 74 68 | 65 20 77 67 6e 75 70 6c |on to th|e wgnupl|
|00002900| 6f 74 20 74 65 78 74 0a | 09 20 2a 20 77 69 6e 64 |ot text.|. * wind|
|00002910| 6f 77 20 2a 2f 0a 09 77 | 68 69 6c 65 20 28 20 66 |ow */..w|hile ( f|
|00002920| 67 65 74 73 28 70 73 42 | 75 66 66 65 72 2c 20 42 |gets(psB|uffer, B|
|00002930| 55 46 46 45 52 5f 53 49 | 5a 45 2c 20 73 74 64 69 |UFFER_SI|ZE, stdi|
|00002940| 6e 29 20 21 3d 20 4e 55 | 4c 4c 20 29 20 7b 0a 09 |n) != NU|LL ) {..|
|00002950| 09 50 6f 73 74 53 74 72 | 69 6e 67 28 68 77 6e 64 |.PostStr|ing(hwnd|
|00002960| 54 65 78 74 2c 20 70 73 | 42 75 66 66 65 72 29 3b |Text, ps|Buffer);|
|00002970| 0a 09 7d 0a 09 0a 09 2f | 2a 20 65 78 69 74 20 67 |..}..../|* exit g|
|00002980| 72 61 63 65 66 75 6c 6c | 79 20 2a 2f 0a 09 2f 2a |racefull|y */../*|
|00002990| 20 43 52 53 3a 20 41 64 | 64 20 61 20 74 65 73 74 | CRS: Ad|d a test|
|000029a0| 20 74 6f 20 73 65 65 20 | 69 66 20 67 6e 75 70 6c | to see |if gnupl|
|000029b0| 6f 74 20 69 73 20 73 74 | 69 6c 6c 20 72 75 6e 6e |ot is st|ill runn|
|000029c0| 69 6e 67 3f 20 2a 2f 0a | 09 50 6f 73 74 53 74 72 |ing? */.|.PostStr|
|000029d0| 69 6e 67 28 68 77 6e 64 | 54 65 78 74 2c 20 22 5c |ing(hwnd|Text, "\|
|000029e0| 6e 65 78 69 74 5c 6e 22 | 29 3b 0a 0a 09 72 65 74 |nexit\n"|);...ret|
|000029f0| 75 72 6e 20 45 58 49 54 | 5f 53 55 43 43 45 53 53 |urn EXIT|_SUCCESS|
|00002a00| 3b 0a 7d 0a | |;.}. | |
+--------+-------------------------+-------------------------+--------+--------+